import axios from '@/libs/api.request'
import { getToken } from '@/libs/util'

/**
 * 按条件查询
 * @param param
 * @returns {AxiosPromise}
 */
export const queryListUserOrg = (param) => {
  return axios.request({
    url: '/admin/userorg/query/wherelist/',
    method: 'post',
    dataType: 'json',
    headers: {
      'Content-Type': 'application/json; charset=UTF-8',
      'token': getToken()
    },
    data: param
  })
}

export const addUserOrg = (param) => {
  return axios.request({
    url: '/admin/userorg/add/',
    method: 'post',
    dataType: 'json',
    headers: {
      'Content-Type': 'application/json; charset=UTF-8',
      'token': getToken()
    },
    data: param
  })
}
export const updateUserOrg = (param) => {
  return axios.request({
    url: '/admin/userorg/update/',
    method: 'post',
    dataType: 'json',
    headers: {
      'Content-Type': 'application/json; charset=UTF-8',
      'token': getToken()
    },
    data: param
  })
}

export const removeUserOrg = (param) => {
  return axios.request({
    url: '/admin/userorg/delete/',
    method: 'post',
    dataType: 'json',
    headers: {
      'Content-Type': 'application/json; charset=UTF-8',
      'token': getToken()
    },
    data: param
  })
}
